﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataLayer.Class;
using System.Collections;

namespace DataLayer.Database
{
    public class MasaTipiDB
    {
        public static ArrayList tumMasaTipleriniCek()
        {
            DBConnection cn = new DBConnection();
            ArrayList masaTipleri = new ArrayList();

            foreach (MASA_TIPI m in cn.ConnectDB.TumMasaTipleriniCek())
            {
                masaTipleri.Add(new MasaTipi(m.MasaTipiID,m.TipAdi,m.Katsayi,m.Resim));
            }
            return masaTipleri;
        }

        public void masaTipiEkle(MasaTipi m)
        {
            DBConnection cn = new DBConnection();
            cn.ConnectDB.MasaTipiEkle(m.TipAdi,m.Katsayi,m.ResimYolu,Session.kullaniciKodu);
        }

        public void masaTipiGuncelle(MasaTipi m)
        {
            DBConnection cn = new DBConnection();
            cn.ConnectDB.MasaTipiDuzenle(m.MasaTipiID,m.TipAdi,m.Katsayi,m.ResimYolu,Session.kullaniciKodu);
        }

        public void masaTipiSil(int masaTipId)
        {
            DBConnection cn = new DBConnection();
            cn.ConnectDB.MasaTipiSil(masaTipId,Session.kullaniciKodu);
        }
    }
}
